<?php
 include "counter2.php";

pagestart();
print "<html>";
pagehead(_("Trends in Linux registration"));
print "\n<body bgcolor=white>";
pagetop(_("Trends in Linux registration"));

print _("The following graphs show some comparative trends among some of the countries at the top of the") . " <a href=\"short.php\">" . _("\"Linux density\" ranking") . "</a> " .
_("Take this as a fun view!") .
"\n<p>" .
"\n<b>" . _("NOTE") . ":</b> " . _("The countries picked are chosen automatically. So if the comments (which are manually entered) seem a bit off, this is the reason!");

function names($rank, $desc='DESC') {
    $query = mysql_query('SELECT name, country FROM temp_short WHERE users >= 2 AND NOT (country LIKE \'X%\') ORDER BY userdensity '. $desc .' LIMIT '. $rank .', 5');
    if ($query == 0) {
        print (_("MySQL error") . ": " . mysql_errno() .":". mysql_error());
        die('Query for country names failed');
    }
    while ($tmp = mysql_fetch_row($query)) {
        $names[] = place_page($tmp[1], $tmp[0]);
    }
    return join(", ", $names);
}

print "\n<h2>1) " . names(0) . "</h2>" .
"\n<img src=\"firstfive.png\" alt=\"" . _("graph") . "\">" .
"\n<br>\n" .
_("Apart from the quite astonishing advantage enjoyed by Antarctica (AQ), home of a Linux-using researcher and Tux the Penguin, we can see a meteoric rise in Danish registrations, probably due to lobbying efforts by Denmark's largest Linux user group.") .
"\n<p>";
print "\n<h2>2) " . names(5) . "</h2>" .
"\n<img src=\"secondfive.png\" alt=\"" . _("graph") . "\">" .
"\n<br>\n" .
_("I think the Linux users in the Faeroes learned of the counter only recently... I have checked that the Norfolk Islander does live on the Norfolk Islands.") .
"\n<p>";
print "\n<h2>3) " . names(10) . "</h2>" .
"\n<img src=\"thirdfive.png\" alt=\"" . _("graph") . "\">" .
"\n<p>\n" .
_("(The \"kink\" in all of these curves in February 1999 is a result of the counter being") . " <a href=\"/slashdot/\">" . _("mentioned on Slashdot") . "</a>)";
print "\n<h2>4) " . names(15) . "</h2>" .
"\n<img src=\"fourthfive.png\" alt=\"" . _("graph") . "\">";
print "\n<h2>5) " . names(20) . "</h2>" .
"\n<img src=\"fifthfive.png\" alt=\"" . _("graph") . "\">" .
"\n<br>";
print "\n<h2>" . _("Last") . ": " . names(0, 'ASC') . "</h2>" .
"\n<img src=\"lastfive.png\" alt=\"" . _("graph") . "\">" .
"\n<br>\n" .
_("The amazing thing about these countries is perhaps not their wide usage of Linux, but that they get registered at all.... if one compares the number of Linux users with the number of Internet hostnames for a country, the ratio can be astonishingly high in a number of 3rd world countries.");

pagebottom();
print "\n</body>\n</html>";
?>

